<template>
	<view class="no-archive">
		<view class="no-data">
			<image :src="props.emptyImage" class="empty-img" :style="{'--img-height': emptyStyle.height + 
			'rpx', '--img-width': emptyStyle.width + 'rpx'}" />
			<view>{{ props.emptyText }}</view>
		</view>
		<slot></slot>
		<!-- <view class="add-btn" @tap="goCreate">创建档案</view> -->
	</view>
</template>

<script setup lang="ts">
const props = defineProps({
	emptyImage: {
		type: String,
		default: 'https://ainengli.meilianshuke.com/jkhx/patient/empty.png'
	},
	emptyText: {
		type: String,
		default: '暂无档案内容'
	},
	showAction: {
		type: Boolean,
		default: false
	},
	emptyStyle: {
		type: Object,
		default: () => ({
			height: 240,
			width: 320
		})
	}
})
// const goCreate = () => {
// 	uni.navigateTo({
// 		url: '/pages/archive/add-archive',
// 	})
// }
</script>

<style scoped lang="scss">
.no-archive {
	// padding: 280rpx 96rpx 0;
	background: #F3F7F8;
	.no-data {
		color: #666666;
		font-size: 28rpx;
		text-align: center;
		.empty-img {
			width: var(--img-width);
			height: var(--img-height);
		}
	}
	.add-btn {
		padding: 22rpx 216rpx;
		background: #00D1B6;
		font-size: 32rpx;
		color: #fff;
		font-weight: bold;
		border-radius: 44rpx;
		margin-top: 48rpx;
	}
}
</style>
